package com.lancoo.ccas53.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lancoo.ccas53.entity.ActiveTeach;
import com.lancoo.ccas53.entity.MajorGrade;
import com.lancoo.ccas53.entity.RuleTimeProhibit;
import com.lancoo.ccas53.entity.RuleWeekDay;
import com.lancoo.ccas53.pojo.common.PageInfo;
import com.lancoo.ccas53.pojo.vo.MaxPeriodScheme;
import com.lancoo.ccas53.pojo.vo.PeriodSchemeGroupVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 课时方案规则 服务类
 * </p>
 *
 * @author quin.song
 * @since 2024-05-20
 */
public interface RuleWeekDayService extends IService<RuleWeekDay> {


    Boolean clearTerm(Integer taskId);

    /**
     * 获取课时方案
     *
     * @param taskId
     * @return
     */
    List<PeriodSchemeGroupVo> getPeriodSchemes(Integer taskId);

    /**
     * 获取课时方案设置
     *
     * @param taskId
     * @return
     */
    List<RuleWeekDay> getWeekDays(Integer taskId);

    /**
     * 获取最大课时方案
     *
     * @param taskId
     * @return
     */
    MaxPeriodScheme getMaxPeriodScheme(Integer taskId);

    /**
     * 更新课时方案设置
     *
     * @param taskId
     * @param weekDays
     * @return
     */
    Boolean updateWeekDay(Integer taskId, List<RuleWeekDay> weekDays);

    /**
     * 复制同学期设置
     *
     * @param taskId
     * @return
     */
    Boolean copyWeekDays(Integer taskId);

    /**
     * 获取时间禁排
     *
     * @param taskId
     * @param optionType
     * @param optionId
     * @return
     */
    List<RuleTimeProhibit> getTimeProhibit(Integer taskId, Integer optionType, Long optionId, Integer hourType);

    /**
     * 设置时间禁排
     *
     * @param taskId
     * @param optionType
     * @param optionIds
     * @param ruleTimeProhibits
     * @return
     */
    boolean setTimeProhibit(Integer taskId, Integer optionType, String optionIds, List<RuleTimeProhibit> ruleTimeProhibits);

    /**
     * 获取专业年级及教学活动安排列表
     *
     * @param page
     * @param taskId
     * @param baseCollegeId
     * @param gradeId
     * @param baseMajorId
     * @param keyword
     * @return
     */
    PageInfo<MajorGrade> getMajorGradeActiveTeachList(Page<MajorGrade> page, Integer taskId, String baseCollegeId, String gradeId, String baseMajorId, String keyword);

    /**
     * 根据年级专业id获取对应教学活动
     *
     * @param taskId
     * @param majorGradeIds
     * @return
     */
    List<ActiveTeach> getActiveTeachByMajorGradeId(Integer taskId, List<Long> majorGradeIds);

    Boolean addActiveTeach(List<ActiveTeach> activeTeach, Integer taskId);

    void exportTeachingActivitySchedule(HttpServletResponse response, Integer taskId, String baseCollegeId, String gradeId, String baseMajorId, String keyword, Integer currentPage, Integer pageSize);

    void importTeachingActivitySchedule(HttpServletResponse response, Integer taskId, Integer flag, MultipartFile file);

    void exportHolidaySchedule(HttpServletResponse response, Integer taskId);

    void importHolidaySchedule(HttpServletResponse response, Integer taskId, Integer flag, MultipartFile file);
}
